﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.OMM.Translator.Interfaces;

namespace Sinacor.OMM.Translator.Translators.STM
{
    public class GenericMessage : BaseTranslator, ITranslator
    {
        private static GenericMessage _instance = null;

        private GenericMessage()
        {
        }

        public static GenericMessage GetInstance()
        {
            if (_instance == null)
                _instance = new GenericMessage();

            return _instance;
        }

        #region ITranslator Members


        public Sinacor.OMM.MessageEntity.BaseMessage TranslateToRouterMessage()
        {
            Sinacor.OMM.MessageEntity.STM.GenericMessage _message = new Sinacor.OMM.MessageEntity.STM.GenericMessage();
            Sinacor.OMM.MessageEntity.BaseMessage baseMessage;
                        
            _message.Original = OriginalMessage.Body;

            baseMessage = TranslateMessageLabel(OriginalMessage.Label);
            _message.SequentialID = baseMessage.SequentialID;
            _message.ID = baseMessage.ID;
            _message.OperationDate = GetOperationDate(_message.ID);

            return _message;
        }

        public Sinacor.OMM.MessageEntity.BaseMessage TranslateToProcessMessage()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
